package com.mew.game.core.common.messge.response;

import com.zebra.common.ZebraBaseMessage;
import io.netty.buffer.ByteBuf;
import lombok.*;


@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class UserMessage extends ZebraBaseMessage<UserMessage> {

    private long uid;
    private String gid;
    private String nickname; //昵称
    private int headPath; // 头像
    private int userLevel; //级数
    private int expProb;   //经验值百分比

    @Override
    public void write(ByteBuf b) {
        writeLong(b, this.uid);
        writeString(b, this.gid);
        writeString(b, this.nickname);
        writeInt(b, this.headPath);
        writeInt(b, this.userLevel);
        writeInt(b, this.expProb);
    }

    @Override
    public UserMessage read(ByteBuf b) {
        this.uid = readLong(b);
        this.gid = readString(b);
        this.headPath = readInt(b);
        this.nickname = readString(b);
        return this;

    }
}
